<!--
 * @Description: 
 * @version: 
 * @Author: m
 * @LastEditors: m
-->
<template>
	<view>
		<!-- <view style="width: 100%; height: 80rpx; border: none; display: flex; justify-content: space-between; align-items: center; background-color: #fa341b">
			<view style="margin-left: 20rpx; color: #ffffff" @click="fanhui"> &lt </view>
			<view style="color: #ffffff; font-size: 30rpx; font-weight: 800; margin-right: 290rpx"> 我的团队 </view>
		</view> -->
		<block class="" v-if="data.length !== 0">
			<view v-for="(i, index) in data" :key="index" @click="jump(i.id)" style="display: flex; margin: 20rpx 0">
				<image :src="i.picture" v-if="i.picture" mode="aspectFit" style="width: 100rpx; height: 100rpx; border-radius: 50%; margin-left: 20rpx"></image>
				<image src="../../../static/topxiang.png" mode="" v-else style="width: 100rpx; height: 100rpx; border-radius: 50%; margin-left: 20rpx"></image>
				<view style="margin-left: 18rpx">
					<!-- scale -->
					<view style="font-size: 32rpx; color: #333333; font-weight: bold">
						{{ i.phone }}
					</view>
					<view style="font-size: 24rpx; color: #333333; margin-top: 8rpx; display: flex">
						<text style="color: red">当前抽成比例:{{ i.scale }}%</text>
					</view>
				</view>
				<view style="width: 180rpx; height: 50rpx; border: 1rpx solid red; text-align: center; line-height: 50rpx; color: red; margin-top: 30rpx; margin-left: 160rpx">设置抽成比例</view>
			</view>
		</block>

		<u-empty text="暂无团队!" mode="history" v-if="data.length == 0"></u-empty>
	</view>
</template>

<script>
export default {
	data() {
		return {
			data: [],
			ins: true,
		};
	},
	onLoad() {
		this.getTheTeam();
		uni.setNavigationBarColor({
			frontColor: "#ffffff",
			backgroundColor: "#FA341B",
			animation: {
				duration: 400,
				timingFunc: "easeIn",
			},
		});
	},
	methods: {
		fanhui() {
			wx.switchTab({
				url: "../me_a",
			});
		},
		jump(id) {
			uni.navigateTo({
				url: "./choucheng?lid=" + id,
			});
		},
		async getTheTeam() {
			let obj = {
				uid: uni.getStorageSync("uid"),
				page: 1,
				limit: 99999,
			};
			const res = await this.$u.post("api/user/user_team", obj, {});
			if (!res.code) uni.$showMsg(res.msg);
			this.data = res.data;
		},
	},
};
</script>

<style>
page {
	background-color: #fcfaff;
}

image {
	background-color: #fff;
}

/deep/ .u-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -150%);
}
</style>
